package com.singletonapps.evory.dao.impl;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.singletonapps.evory.dao.RoleDao;
import com.singletonapps.evory.dto.RoleDto;
import com.singletonapps.evory.entities.Role;

@Repository
public class RoleDaoImpl implements RoleDao {
    
    @Autowired
    private SessionFactory session;
    
    @Override
    public void create(RoleDto role) {
        session.getCurrentSession().save(role);
    }

    @Override
    public void update(RoleDto role) {

    }

    @Override
    public void delete(RoleDto role) {

    }

    @Override
    public Role getRole(Long id) {

        return (Role) session.getCurrentSession().get(Role.class, id);
    }

    @Override
    public List<RoleDto> getAllRoles() {
        return null;
    }

}
